#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ..models import Model


class ResPartner(Model):
    _name = 'res.partner'

    def search(self, *args, **kwargs):
        print('in ResPartner')
        return super().search(*args, **kwargs)

    def search_read(self, *args,  **kwargs):
        print('in ResPartner',  args, kwargs)
        return super().search_read(*args,  **kwargs)


class ResPartnerCompany(ResPartner):
    _name = 'res.partner.company'
    _inherit = 'res.partner'

    def search(self, *args, **kwargs):
        print('in ResPartnerCompany')
        return super().search(*args, **kwargs)

    def search_read(self, domain=None, *args, **kwargs):
        print('in ResPartnerCompany', domain, args, kwargs)
        if not domain:
            domain = []
        domain = domain + [('is_company', '=', True)]
        return super().search_read(domain, *args,  **kwargs)


class ResPartnerCompanyCustomer(ResPartnerCompany):
    _name = 'res.partner.company.customer'
    _inherit = 'res.partner'

    def search(self, *args, **kwargs):
        print('in ResPartnerCompanyCustomer')
        return super().search(*args, **kwargs)
